import { Middleware } from "redux";
import i18n from "i18next";
export const changeLanguage: Middleware = (store) => (next) => (action) => {
  if (action.type === "languageChangeToAdd/languageChange") {
    next(action);
    i18n.changeLanguage(store.getState().languageReducer.language);
  } else {
    next(action);
  }
};

